#include "pcloud_scans/grid_Dz.h"
//判断该点前后左右的高度差
//将直线段分成两类
void Get_key_lines(const std::vector<Point> Laser_sacn, std::vector<Line>& real_line)//0-7
{
    //printf("111\n");
    for(int i=0; i<real_line.size(); i++)
    {   
        std::vector<double> Point_hight;
        //printf("222  %d %d \n", real_line[i].start_index,real_line[i].end_index); 

        int start = real_line[i].end_index-10>0 ? real_line[i].end_index-10:0;
        int end = real_line[i].start_index+10<(int)Laser_sacn.size() ? real_line[i].start_index+10:(int)Laser_sacn.size();

        for(int j=start; j<end; j++)
        {
            Point_hight.push_back(Laser_sacn[j].z);
        }
        std::sort(Point_hight.begin(),Point_hight.end());
        //printf("333\n");
        //printf("333  %d\n", (int)Point_hight.size());
        if(fabs(Point_hight[0] - Point_hight[Point_hight.size()-1]) < 0.02)
        {
            real_line.erase(real_line.begin() + i);//先保留，然后和最后的结果分分扫描线对比kb，kb差值极小的保留下来
            i--;
        }
        //printf("444\n");
    }
}